<?php

$nbEmprunt= 1;

if(isset($_GET['nbEmprunt'])){
	$nbEmprunt = $_GET['nbEmprunt'];
}

?>
<fieldset class='fieldset_section'>

	<legend>
		Objet du financement
		<?php echo $nbEmprunt ?>
	</legend>
	<table>
		<tr>
			<td class='label'><label for='montant'>Montant (€)*</label></td>
			<td class='input'><input type='text' name='montant<?php echo $nbEmprunt ?>'
				id='montant<?php echo $nbEmprunt?>' maxlength="50" value="0" /></td>
			<td class='separator'>
				<!-- SEPARETOR -->
			</td>
			<td class='label'><label for='taux'>Taux (%)*</label></td>
			<td class='input'><input type='text' name='taux<?php echo $nbEmprunt ?>'
				id='taux<?php echo $nbEmprunt ?>' maxlength="50" value="0" /></td>
		</tr>
		<tr>
			<td class='label'><label for='duree'>Durée (mois)*</label></td>
			<td class='input'><input type='text' name='duree<?php echo $nbEmprunt ?>'
				id='duree<?php echo $nbEmprunt?>'
				maxlength="50" value="0" /></td>
			<td class='separator'>
				<!-- SEPARETOR -->
			</td>
			<td class='label'><label for='quotas'>Quotit&eacute; &agrave; assurer
					(%)*</label></td>
			<td class='input'><input type='text' name='quotas<?php echo $nbEmprunt ?>'
				id='quotas<?php echo $nbEmprunt ?>' maxlength="50" value="0" /></td>
		</tr>
		<tr>
			<td class='label'><label for='contrat_differe'>Contrat
					diff&eacute;r&eacute; (mois)</label></td>
			<td class='input'><input type='text' name='contrat_differe<?php echo $nbEmprunt ?>'
				id='contrat_differe<?php echo $nbEmprunt ?>' maxlength="50"
				value="0" /></td>
			<td class='separator'>
				<!-- SEPARETOR -->
			</td>
			<td class='label'><label for='date_signature_prevu'>Date Signature</label>
			</td>
			<td class='input'><input type='text' name='date_signature_prevu<?php echo $nbEmprunt ?>'
				id='date_signature_prevu<?php echo $nbEmprunt ?>' maxlength="10"
				readonly="readonly" /></td>
		</tr>
		<tr>
			<td class='label'><label for='type_pret'>Type de pr&ecirc;t</label></td>
			<td class='input'><input type='text' name='type_pret<?php echo $nbEmprunt ?>'
				id='type_pret<?php echo $nbEmprunt?>' maxlength="50" /></td>
			<td class='separator'>
				<!-- SEPARETOR -->
			</td>
			<td class='label'><label for='numero_pret'>Num&eacute;ro du
					pr&ecirc;t</label></td>
			<td class='input'><input type='text' name='numero_pret<?php echo $nbEmprunt ?>'
				id='numero_pret<?php echo $nbEmprunt ?>' maxlength="50" /></td>
		</tr>
		<tr>
			<td class='label'><label for='remarques'>Remarques</label></td>
			<td class='input'><textarea rows="2" name='remarques<?php echo $nbEmprunt ?>'
					id='remarques<?php echo $nbEmprunt  ?>'></textarea></td>
			<td class='separator'>
				<!-- SEPARETOR -->
			</td>
			<td class='label'><label>Couvertures*</label></td>
			<td class='input'><input type='checkbox' name='deces<?php echo $nbEmprunt ?>'
				id='deces<?php echo $nbEmprunt ?>' checked="checked" /><label
				for='deces'>D&eacute;c&egrave;s</label> &nbsp;&nbsp;<input
				type='checkbox' name='chomage<?php echo $nbEmprunt ?>' id='chomage<?php echo $nbEmprunt ?>'
				onclick='javascript:manageCouverture()' /><label for='chomage'>Chomage</label>
				<br /> <input type='checkbox' name='PTIA<?php echo $nbEmprunt ?>'
				id='PTIA<?php echo $nbEmprunt ?>' /><label for='PTIA'>PTIA</label>
				&nbsp;&nbsp;&nbsp;&nbsp;<input type='checkbox' name='ITT<?php echo $nbEmprunt ?>'
				id='ITT<?php echo $nbEmprunt ?>' /><label for='ITT'>ITT</label>
			</td>
		</tr>
	</table>
</fieldset>

<div id="emprunt<?php echo $nbEmprunt + 1 ?>">
	<div>
		<table align="center">
			<tr>
			<?php if($nbEmprunt > 1) {?>
				<td><input type='button'
					onclick="javascript:removeEmprunt(<?php  echo $nbEmprunt?>)"
					value='Supprimer' /></td>
					<?php }?>
				<td><input type='button'
					onclick="javascript:addEmprunt(<?php  echo $nbEmprunt + 1 ?>)"
					value='Ajouter' /></td>
				
			</tr>
		</table>
	</div>
</div>
<script type="text/javascript">
	new datepickr('date_signature_prevu<?php echo $nbEmprunt ?>', { 'dateFormat': 'd-m-Y', });			
</script>
